package com.hbu.search.hbumallsearch.controller;

import com.hbu.search.hbumallsearch.service.MallSearchService;
import com.hbu.search.hbumallsearch.vo.SearchParam;
import com.hbu.search.hbumallsearch.vo.SearchResult;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 * @author 90458
 */
@Controller
@AllArgsConstructor
public class SearchController {

    MallSearchService mallSearchService;

    @GetMapping("/list.html")
    public String listPage(SearchParam searchParam, Model model) {
        SearchResult result = mallSearchService.search(searchParam);
        model.addAttribute("result", result);
        return "list";
    }

}
